<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        ul {
            list-style: none;
        }

        html,
        body {
            width: 100%;
            height: 100%;
            display: flex;
        }

        .left {
            width: 60%;
            height: 100%;
            background-color: palegoldenrod;
        }

        ul {
            width: 100%;
            height: 100%;
            display: flex;
            flex-wrap: wrap;
        }

        .right {
            width: 40%;
            height: 100%;
            background-color: paleturquoise;
        }

        li {
            display: block;
            width: 24%;
            margin-right: 1%;
            height: 50%;
            background-color: antiquewhite;
        }

        img {
            width: 100%;
            height: 70%;
        }

        h2 {
            font-weight: normal;
            display: block;
            margin-left: 20px;
            font-size: 16px;
        }

        p {
            display: block;
            margin-left: 20px;
            font-size: 16px;
        }

        button {
            display: block;
            margin-left: 20px;
            font-size: 16px;
            background-color: red;
            border: 1px solid black;
            width: 100px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            color: white;
        }

        .oro {
            display: inline-block;
            width: 100px;
            height: 100px;
            vertical-align: middle;
        }

        span {
            padding-left: 50px;
        }

        .pop {
            display: block;
            padding: 20px;
        }
    </style>
</head>

<body>
    <div class="left">
        <ul>
            <li>
                <img src="img/1.png" alt="">
                <h2>高级办公椅</h2>
                <p>10000</p>
                <button>加入购物车</button>
            </li>
            <li>
                <img src="img/2.png" alt="">
                <h2>高级按摩椅</h2>
                <p>1000</p>
                <button>加入购物车</button>
            </li>
            <li>
                <img src="img/3.png" alt="">
                <h2>高级电动按摩椅</h2>
                <p>100</p>
                <button>加入购物车</button>
            </li>
            <li>
                <img src="img/4.png" alt="">
                <h2>电动按摩椅</h2>
                <p>10</p>
                <button>加入购物车</button>
            </li>
            <li>
                <img src="img/5.png" alt="">
                <h2>老板椅</h2>
                <p>20000</p>
                <button>加入购物车</button>
            </li>
            <li>
                <img src="img/6.png" alt="">
                <h2>办公桌</h2>
                <p>50000</p>
                <button>加入购物车</button>
            </li>
            <li>
                <img src="img/7.png" alt="">
                <h2>可升降办公椅</h2>
                <p>5000</p>
                <button>加入购物车</button>
            </li>
            <li>
                <img src="img/8.png" alt="">
                <h2>可升降办公桌</h2>
                <p>2000</p>
                <button>加入购物车</button>
            </li>
        </ul>
    </div>
    <div class="right">
        <h3>购物车</h3>
        <input type="checkbox">
        <img src="img/1.png" alt="" class="oro">
        <span>10</span>
        <span>1</span>
        <span>删除收藏</span>
        <span class="pop">电动按摩椅</span>
    </div>
</body>

</html>
<script>
    var count = 0
    var btns = document.querySelectorAll('button')
    for (let i = 0; i < btns.length; i++) {
        this.btns[i].onclick = function (e) {
            count++
            console.log(count);
        }
    }
</script>